SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vw_Puntajes
AS
SELECT L2.localidad AS LocalidadInscripcion, 
    A.Documento AS Expr1, A.idAgente AS Expr2, 
    A.Nombres AS Expr3, A.Domicilio AS Expr4, 
    L.localidad AS LocalidadAgente, A.Telefono AS Expr6, 
    IC.*
FROM tb_Agentes A INNER JOIN
    tb_Localidades L ON L.idLocalidad = A.Localidad INNER JOIN
    tb_InscripcionesConvocatorias IC ON 
    IC.Agente = A.idAgente INNER JOIN
    tb_CargosGenericos CG ON 
    CG.idCargoGenerico = IC.CargoGenerico INNER JOIN
    tb_AsignaturasGenericas AG ON 
    AG.idAsignaturaGenerica = IC.AsignaturaGenerica INNER JOIN
    tb_Localidades L2 ON L2.idLocalidad = IC.Localidad
GO
GRANT SELECT ON  [dbo].[vw_Puntajes] TO [SoloVer]
GO
